
package com.monlyu.vo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Transient;

import com.monlyu.annotation.Comment;
import com.monlyu.util.StringUtil;

/*******************************************************************************
 * <b>功能描述☞</b>编辑方案内容表<br>
 * <b>开发公司☞</b>重庆唯尼科技有限公司<br>
 * <b>版权☞</b>本文件归重庆唯尼科技有限公司所有<br>
 * <b>项目名☞</b>news_cd<br>
 * <b>文件路径☞</b>com.monlyu.vo.SolutionContent.java<br>
 * <b>开发日期☞</b>2011-6-25 <br>
 * 
 * @author chendan
 * @since JDK 5
 * @version 1.0.8
 ******************************************************************************/
@Entity(name = "t_solutioncontent")
public class SolutionContent extends BaseVo {

    @Id
    @Column(name = "s_id")
    @Comment(common = "编号")
    private Long id;

    @Column(name = "s_order", nullable = false)
    @Comment(common = "顺序")
    private int order;

    @Column(name = "s_page", length = MAX_VCHAR_MYSQL)
    @Comment(common = "页码")
    private String page;

    @ManyToOne
    @JoinColumn(name = "s_manuscript")
    @Comment(common = "稿件")
    private Manuscript manuscript;

    @Column(name = "s_desc", length = LENGTH_2000)
    @Comment(common = "描述")
    private String desc;

    @ManyToOne
    @JoinColumn(name = "s_solutionItem")
    private SolutionItem solutionItem;

    @Column(name = "s_status")
    @Comment(common = "状态：true有效，false无效")
    private boolean status;

    @Column(name = "s_recorderDate")
    @Comment(common = "创建时间")
    private Date recorderDate;

    @ManyToOne
    @JoinColumn(name = "s_recorder")
    @Comment(common = "创建人")
    private User recorder;

    @Column(name = "s_dropDate")
    @Comment(common = "删除时间")
    private Date dropDate;

    @ManyToOne
    @JoinColumn(name = "s_dropUser")
    @Comment(common = "删除人")
    private User dropUser;

    @Transient
    private String begin = "";

    @Transient
    private String end = "";

    public String getBegin(){
        if (!StringUtil.isTrimEmpty(page)) {
            begin = this.page.split("-")[0];
        }
        return begin;
    }

    public String getEnd(){
        if (!StringUtil.isTrimEmpty(page)) {
            String[] a = this.page.split("-");
            end = a.length > 1 ? a[1] : "";
        }
        return end;
    }

    public Long getId(){
        return id;
    }

    public void setId(Long id){
        this.id = id;
    }

    public int getOrder(){
        return order;
    }

    public void setOrder(int order){
        this.order = order;
    }

    public String getPage(){
        return page;
    }

    public void setPage(String page){
        this.page = page;
    }

    public Manuscript getManuscript(){
        return manuscript;
    }

    public void setManuscript(Manuscript manuscript){
        this.manuscript = manuscript;
    }

    public String getDesc(){
        return desc;
    }

    public void setDesc(String desc){
        this.desc = desc;
    }

    public boolean isStatus(){
        return status;
    }

    public void setStatus(boolean status){
        this.status = status;
    }

    public Date getRecorderDate(){
        return recorderDate;
    }

    public void setRecorderDate(Date recorderDate){
        this.recorderDate = recorderDate;
    }

    public User getRecorder(){
        return recorder;
    }

    public void setRecorder(User recorder){
        this.recorder = recorder;
    }

    public Date getDropDate(){
        return dropDate;
    }

    public void setDropDate(Date dropDate){
        this.dropDate = dropDate;
    }

    public User getDropUser(){
        return dropUser;
    }

    public void setDropUser(User dropUser){
        this.dropUser = dropUser;
    }

    public SolutionItem getSolutionItem(){
        return solutionItem;
    }

    public void setSolutionItem(SolutionItem solutionItem){
        this.solutionItem = solutionItem;
    }

}
